    function set(a,c,p1,p2,p3,charset) {
        if(a != null)document.mf.a.value=a;
        if(c != null)document.mf.c.value=c;
        if(p1 != null)document.mf.p1.value=p1;
        if(p2 != null)document.mf.p2.value=p2;
        if(p3 != null)document.mf.p3.value=p3;
        if(charset != null)document.mf.charset.value=charset;
    }
    function g(a,c,p1,p2,p3,charset) {
        set(a,c,p1,p2,p3,charset);
        document.mf.submit();
    }
    function a(a,c,p1,p2,p3,charset) {
        set(a,c,p1,p2,p3,charset);
        var params = "ajax=true";
        for(i=0;i<document.mf.elements.length;i++)
            params += "&"+document.mf.elements[i].name+"="+encodeURIComponent(document.mf.elements[i].value);
        sr('<?php echo $_SERVER['REQUEST_URI'];?>', params);
    }
    function sr(url, params) {    
        if (window.XMLHttpRequest) {
            req = new XMLHttpRequest();
            req.onreadystatechange = processReqChange;
            req.open("POST", url, true);
            req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
            req.send(params);
        } 
        else if (window.ActiveXObject) {
            req = new ActiveXObject("Microsoft.XMLHTTP");
            if (req) {
                req.onreadystatechange = processReqChange;
                req.open("POST", url, true);
                req.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
                req.send(params);
            }
        }
    }
    function processReqChange() {
        if( (req.readyState == 4) )
            if(req.status == 200) {
                //alert(req.responseText);
                var reg = new RegExp("(\\d+)([\\S\\s]*)", "m");
                var arr=reg.exec(req.responseText);
                eval(arr[2].substr(0, arr[1]));
            } 
            else alert("Request error!");
    }